import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  mode: 'hash',

  routes: [
    { path: '/login', component: () => import('@/views/loginPage.vue') }, // 登录页
    {
      path: '/',
      redeict: '/layout',
      component: () => import('@/views/layout/layoutPage.vue'),
    },
    {
      path: '/layout',
      component: () => import('@/views/layout/layoutPage.vue'),
    },
    {
      path: '/service',
      children: [
        {
          path: '/service/contactUs', // 子路由的路径
          component: () => import('@/views/service/contactUs.vue') // 子路由对应的组件
        },
        {
          path: '/service/helpCenter',
          component: () => import('@/views/service/helpCenter.vue'),
        }
      ]
    },
    {
      path: '/record',
      children: [
        {
          path: '/record/category', // 子路由的路径
          component: () => import('@/views/record/recordPage.vue'), // 子路由对应的组件
        },
        {
          path: '/record/view', // 子路由的路径
          component: () => import('@/views/record/recordView.vue'), // 子路由对应的组件
        }
      ]
    },
    {
      path: '/exchange',
      children: [
        {
          path: '/exchange/professor', // 子路由的路径
          component: () => import('@/views/exchange/professorMeeting.vue'), // 子路由对应的组件
        },
        {
          path: '/exchange/discussionForum', // 子路由的路径
          component: () => import('@/views/exchange/discussionForum.vue'), // 子路由对应的组件
        },
        {
          path: '/exchange/aboutUs', // 子路由的路径
          component: () => import('@/views/exchange/aboutUs.vue'), // 子路由对应的组件
        }, {
          path: '/exchange/feedBack', // 子路由的路径
          component: () => import('@/views/exchange/feedBack.vue'), // 子路由对应的组件
        },

      ]
    },

  ],
  linkActiveClass: 'active',
  linkExactActiveClass: 'exact-active',
})


export default router
